package net.pulseproject.router.modules;

public abstract class Module {
	
	private final String id;
	
	public Module(final String id) {
		if(id == null) { throw new IllegalArgumentException("id == null"); }
		if(id.isEmpty()) { throw new IllegalArgumentException("id is empty"); }
		this.id = id;
	}
	
	public final String getId() {
		return this.id;
	}
	
	
	@Override
	public final boolean equals(final Object other) {
		if((other instanceof Module) == false) {
			return false;
		}
		final Module that = (Module) other;
		return this.id.equals(that.id);
	}
	
	@Override
	public final int hashCode() {
		return this.id.hashCode();
	}
}
